package 异常;

import org.junit.Test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExcepTionDemo {
    @Test
    public void test1(){
        //编译时异常
        try {
            FileInputStream fileInputStream =
                    new FileInputStream("java.txt");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
    @Test
    public void  test2() throws FileNotFoundException {
        FileInputStream fileInputStream =
                new FileInputStream("java.txt");
    }

}
